package com.ymttest.common.enums;

/**
 * 优惠券类型
 */
public enum CouponTypeEnum {
	/**
	 * 公众优惠券
	 */
	Public(1),

	/**
	 * 专有优惠券
	 */
	Private(2);

	private int intValue;
	private static java.util.HashMap<Integer, CouponTypeEnum> mappings;

	private synchronized static java.util.HashMap<Integer, CouponTypeEnum> getMappings() {
		if (mappings == null) {
			mappings = new java.util.HashMap<Integer, CouponTypeEnum>();
		}
		return mappings;
	}

	private CouponTypeEnum(int value) {
		intValue = value;
		CouponTypeEnum.getMappings().put(value, this);
	}

	public int getValue() {
		return intValue;
	}

	public static CouponTypeEnum forValue(int value) {
		return getMappings().get(value);
	}
}